Optimal. Leaf size=103 \[ -\frac{a^2 \cos ^5(c+d x)}{10 d}+\frac{a^2 \sin (c+d x) \cos ^3(c+d x)}{8 d}+\frac{3 a^2 \sin (c+d x) \cos (c+d x)}{16 d}+\frac{3 a^2 x}{16}-\frac{\cos ^3(c+d x) (a \sin (c+d x)+a)^3}{6 a d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.167851, antiderivative size = 103, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 4, integrand size = 29, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.138, Rules used = {2870, 2669, 2635, 8} \[ -\frac{a^2 \cos ^5(c+d x)}{10 d}+\frac{a^2 \sin (c+d x) \cos ^3(c+d x)}{8 d}+\frac{3 a^2 \sin (c+d x) \cos (c+d x)}{16 d}+\frac{3 a^2 x}{16}-\frac{\cos ^3(c+d x) (a \sin (c+d x)+a)^3}{6 a d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2870
Rule 2669
Rule 2635
Rule 8
Rubi steps
\begin{align*} \int \cos ^2(c+d x) \sin ^2(c+d x) (a+a \sin (c+d x))^2 \, dx &=-\frac{\cos ^3(c+d x) (a+a \sin (c+d x))^3}{6 a d}+\frac{1}{2} a \int \cos ^4(c+d x) (a+a \sin (c+d x)) \, dx\\ &=-\frac{a^2 \cos ^5(c+d x)}{10 d}-\frac{\cos ^3(c+d x) (a+a \sin (c+d x))^3}{6 a d}+\frac{1}{2} a^2 \int \cos ^4(c+d x) \, dx\\ &=-\frac{a^2 \cos ^5(c+d x)}{10 d}+\frac{a^2 \cos ^3(c+d x) \sin (c+d x)}{8 d}-\frac{\cos ^3(c+d x) (a+a \sin (c+d x))^3}{6 a d}+\frac{1}{8} \left (3 a^2\right ) \int \cos ^2(c+d x) \, dx\\ &=-\frac{a^2 \cos ^5(c+d x)}{10 d}+\frac{3 a^2 \cos (c+d x) \sin (c+d x)}{16 d}+\frac{a^2 \cos ^3(c+d x) \sin (c+d x)}{8 d}-\frac{\cos ^3(c+d x) (a+a \sin (c+d x))^3}{6 a d}+\frac{1}{16} \left (3 a^2\right ) \int 1 \, dx\\ &=\frac{3 a^2 x}{16}-\frac{a^2 \cos ^5(c+d x)}{10 d}+\frac{3 a^2 \cos (c+d x) \sin (c+d x)}{16 d}+\frac{a^2 \cos ^3(c+d x) \sin (c+d x)}{8 d}-\frac{\cos ^3(c+d x) (a+a \sin (c+d x))^3}{6 a d}\\ \end{align*}
Mathematica [A] time = 0.429726, size = 76, normalized size = 0.74 \[ \frac{a^2 (-15 \sin (2 (c+d x))-45 \sin (4 (c+d x))+5 \sin (6 (c+d x))-240 \cos (c+d x)-40 \cos (3 (c+d x))+24 \cos (5 (c+d x))+180 c+180 d x)}{960 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.034, size = 142, normalized size = 1.4 \begin{align*}{\frac{1}{d} \left ({a}^{2} \left ( -{\frac{ \left ( \sin \left ( dx+c \right ) \right ) ^{3} \left ( \cos \left ( dx+c \right ) \right ) ^{3}}{6}}-{\frac{ \left ( \cos \left ( dx+c \right ) \right ) ^{3}\sin \left ( dx+c \right ) }{8}}+{\frac{\cos \left ( dx+c \right ) \sin \left ( dx+c \right ) }{16}}+{\frac{dx}{16}}+{\frac{c}{16}} \right ) +2\,{a}^{2} \left ( -1/5\, \left ( \sin \left ( dx+c \right ) \right ) ^{2} \left ( \cos \left ( dx+c \right ) \right ) ^{3}-2/15\, \left ( \cos \left ( dx+c \right ) \right ) ^{3} \right ) +{a}^{2} \left ( -{\frac{ \left ( \cos \left ( dx+c \right ) \right ) ^{3}\sin \left ( dx+c \right ) }{4}}+{\frac{\cos \left ( dx+c \right ) \sin \left ( dx+c \right ) }{8}}+{\frac{dx}{8}}+{\frac{c}{8}} \right ) \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.13309, size = 126, normalized size = 1.22 \begin{align*} \frac{128 \,{\left (3 \, \cos \left (d x + c\right )^{5} - 5 \, \cos \left (d x + c\right )^{3}\right )} a^{2} - 5 \,{\left (4 \, \sin \left (2 \, d x + 2 \, c\right )^{3} - 12 \, d x - 12 \, c + 3 \, \sin \left (4 \, d x + 4 \, c\right )\right )} a^{2} + 30 \,{\left (4 \, d x + 4 \, c - \sin \left (4 \, d x + 4 \, c\right )\right )} a^{2}}{960 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.65558, size = 211, normalized size = 2.05 \begin{align*} \frac{96 \, a^{2} \cos \left (d x + c\right )^{5} - 160 \, a^{2} \cos \left (d x + c\right )^{3} + 45 \, a^{2} d x + 5 \,{\left (8 \, a^{2} \cos \left (d x + c\right )^{5} - 26 \, a^{2} \cos \left (d x + c\right )^{3} + 9 \, a^{2} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{240 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 11.8154, size = 309, normalized size = 3. \begin{align*} \begin{cases} \frac{a^{2} x \sin ^{6}{\left (c + d x \right )}}{16} + \frac{3 a^{2} x \sin ^{4}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{16} + \frac{a^{2} x \sin ^{4}{\left (c + d x \right )}}{8} + \frac{3 a^{2} x \sin ^{2}{\left (c + d x \right )} \cos ^{4}{\left (c + d x \right )}}{16} + \frac{a^{2} x \sin ^{2}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{4} + \frac{a^{2} x \cos ^{6}{\left (c + d x \right )}}{16} + \frac{a^{2} x \cos ^{4}{\left (c + d x \right )}}{8} + \frac{a^{2} \sin ^{5}{\left (c + d x \right )} \cos{\left (c + d x \right )}}{16 d} - \frac{a^{2} \sin ^{3}{\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{6 d} + \frac{a^{2} \sin ^{3}{\left (c + d x \right )} \cos{\left (c + d x \right )}}{8 d} - \frac{2 a^{2} \sin ^{2}{\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{3 d} - \frac{a^{2} \sin{\left (c + d x \right )} \cos ^{5}{\left (c + d x \right )}}{16 d} - \frac{a^{2} \sin{\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{8 d} - \frac{4 a^{2} \cos ^{5}{\left (c + d x \right )}}{15 d} & \text{for}\: d \neq 0 \\x \left (a \sin{\left (c \right )} + a\right )^{2} \sin ^{2}{\left (c \right )} \cos ^{2}{\left (c \right )} & \text{otherwise} \end{cases} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.34954, size = 143, normalized size = 1.39 \begin{align*} \frac{3}{16} \, a^{2} x + \frac{a^{2} \cos \left (5 \, d x + 5 \, c\right )}{40 \, d} - \frac{a^{2} \cos \left (3 \, d x + 3 \, c\right )}{24 \, d} - \frac{a^{2} \cos \left (d x + c\right )}{4 \, d} + \frac{a^{2} \sin \left (6 \, d x + 6 \, c\right )}{192 \, d} - \frac{3 \, a^{2} \sin \left (4 \, d x + 4 \, c\right )}{64 \, d} - \frac{a^{2} \sin \left (2 \, d x + 2 \, c\right )}{64 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]